var express = require('express');
var session = require('express-session');
var app = express();
var config = require("../config.json");
app.use(session({
	secret: '1231231321', //secret的值建议使用随机字符串
	cookie: {
		maxAge: 6 * 1000
	} // 过期时间（毫秒）
}));
/*缓存*/
var redis = require('redis'),
	RDS_PORT = config.redis.RDS_PORT, //端口号    
	RDS_HOST = config.redis.RDS_HOST, //服务器IP  要连接的A服务器redis    
	RDS_PWD = config.redis.RDS_PWD, //密码    
	RDS_OPTS = {
		auth_pass: RDS_PWD
	}, //设置项    
	client = redis.createClient(RDS_PORT, RDS_HOST, RDS_OPTS);
client.auth(RDS_PWD, function(res) {
	console.log(res)
	console.log('通过认证');
});
module.exports = client;